/************************************************************
 * Project Name         [Thinking_In_Java]
 * File Name            [Line.java]
 * Creation Date        [12-Jul-2014]
 * 
 * Copyright© ge.y.yang@gmail.com All Rights Reserved
 * 
 * Work hard, play harder, think big and keep fit
 ************************************************************/
package pkg_02_gui.sketchpad.shape;

import java.awt.Color;
import java.awt.Graphics;

/**
 * 直线
 * 
 * @author 不落的太阳(Sean Yang)
 * @version 1.0
 * @since JDK 6
 * 
 */
public class Line implements Shape {

	// 直线的起始位置
	private int x1, y1;
	// 直线的终止位置
	private int x2, y2;

	private Color lineColor;

	public Line(int x1, int y1, int x2, int y2, Color lineColor) {
		super();
		this.x1 = x1;
		this.y1 = y1;
		this.x2 = x2;
		this.y2 = y2;
		this.lineColor = lineColor;
	}

	public Line() {
		super();
	}

	@Override
	public void paint(Graphics g) {
		g.setColor(lineColor);
		g.drawLine(x1, y1, x2, y2);
	}

}
